\hypertarget{internal__comm__rx__queue_8h}{
\section{internal\_\-comm\_\-rx\_\-queue.h File Reference}
\label{internal__comm__rx__queue_8h}\index{internal\_\-comm\_\-rx\_\-queue.h@{internal\_\-comm\_\-rx\_\-queue.h}}
}
The internal communication RX QUEUE.  


{\tt \#include \char`\"{}internal\_\-comm.h\char`\"{}}\par
\subsection*{Classes}
\begin{CompactItemize}
\item 
struct \hyperlink{structrx__linked__list}{rx\_\-linked\_\-list}
\begin{CompactList}\small\item\em The structure of the RX circular buffer. \item\end{CompactList}\end{CompactItemize}
\subsection*{Defines}
\begin{CompactItemize}
\item 
\hypertarget{internal__comm__rx__queue_8h_e9c2bad4438c061a6c324ced5597755f}{
\#define \hyperlink{internal__comm__rx__queue_8h_e9c2bad4438c061a6c324ced5597755f}{INTERNAL\_\-COMM\_\-RX\_\-QUEUE\_\-SIZE}~5}
\label{internal__comm__rx__queue_8h_e9c2bad4438c061a6c324ced5597755f}

\begin{CompactList}\small\item\em The size of the RX QUEUE. \item\end{CompactList}\end{CompactItemize}
\subsection*{Typedefs}
\begin{CompactItemize}
\item 
\hypertarget{internal__comm__rx__queue_8h_0c4fd3cca30240869b80ec7e7cfa8067}{
typedef struct \hyperlink{structrx__linked__list}{rx\_\-linked\_\-list} \hyperlink{internal__comm__rx__queue_8h_0c4fd3cca30240869b80ec7e7cfa8067}{int\_\-comm\_\-rx\_\-queue\_\-struct}}
\label{internal__comm__rx__queue_8h_0c4fd3cca30240869b80ec7e7cfa8067}

\begin{CompactList}\small\item\em The structure of the RX circular buffer. \item\end{CompactList}\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
void \hyperlink{internal__comm__rx__queue_8h_f49ccedaef51b44c7e16395027bfd551}{int\_\-comm\_\-rx\_\-queue\_\-add} (\hyperlink{structUC__MESSAGE}{UC\_\-MESSAGE} message)
\begin{CompactList}\small\item\em Insert a message into the TX queue (FIFO). \item\end{CompactList}\item 
\hyperlink{structUC__MESSAGE}{UC\_\-MESSAGE} \hyperlink{internal__comm__rx__queue_8h_6564d12f3118d4f012088efa9b764b00}{int\_\-comm\_\-rx\_\-queue\_\-get} (void)
\begin{CompactList}\small\item\em Retrieve the first message from the FIFO TX queue. \item\end{CompactList}\item 
void \hyperlink{internal__comm__rx__queue_8h_41645be7df154233c61d3789752ae6e2}{int\_\-comm\_\-rx\_\-queue\_\-drop} (void)
\item 
void \hyperlink{internal__comm__rx__queue_8h_39b69a3f665580fc26505892fe38a649}{int\_\-comm\_\-rx\_\-queue\_\-dropall} (void)
\begin{CompactList}\small\item\em Erase all content in the TX queue. \item\end{CompactList}\item 
\hypertarget{internal__comm__rx__queue_8h_b9e9f0a780a7b0fb372a64f5ec161524}{
void \hyperlink{internal__comm__rx__queue_8h_b9e9f0a780a7b0fb372a64f5ec161524}{int\_\-comm\_\-rx\_\-queue\_\-init} (void)}
\label{internal__comm__rx__queue_8h_b9e9f0a780a7b0fb372a64f5ec161524}

\begin{CompactList}\small\item\em Initialize the internal comm rx queue. \item\end{CompactList}\item 
unsigned char \hyperlink{internal__comm__rx__queue_8h_e24971f6543c6471788b8b042331909b}{int\_\-comm\_\-rx\_\-queue\_\-is\_\-empty} (void)
\begin{CompactList}\small\item\em Check if the queue is empty. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
The internal communication RX QUEUE. 

\begin{Desc}
\item[Author:]Mikael Larsmark, SM2WMV \end{Desc}
\begin{Desc}
\item[Date:]2010-01-25 

\begin{Code}\begin{verbatim} #include "internal_comm_rx_queue.h" 
\end{verbatim}
\end{Code}

 \end{Desc}


Definition in file \hyperlink{internal__comm__rx__queue_8h-source}{internal\_\-comm\_\-rx\_\-queue.h}.

\subsection{Function Documentation}
\hypertarget{internal__comm__rx__queue_8h_f49ccedaef51b44c7e16395027bfd551}{
\index{internal\_\-comm\_\-rx\_\-queue.h@{internal\_\-comm\_\-rx\_\-queue.h}!int\_\-comm\_\-rx\_\-queue\_\-add@{int\_\-comm\_\-rx\_\-queue\_\-add}}
\index{int\_\-comm\_\-rx\_\-queue\_\-add@{int\_\-comm\_\-rx\_\-queue\_\-add}!internal_comm_rx_queue.h@{internal\_\-comm\_\-rx\_\-queue.h}}
\subsubsection[{int\_\-comm\_\-rx\_\-queue\_\-add}]{\setlength{\rightskip}{0pt plus 5cm}void int\_\-comm\_\-rx\_\-queue\_\-add ({\bf UC\_\-MESSAGE} {\em message})}}
\label{internal__comm__rx__queue_8h_f49ccedaef51b44c7e16395027bfd551}


Insert a message into the TX queue (FIFO). 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em message}]- The message that should be inserted to the queue \end{description}
\end{Desc}


Definition at line 43 of file internal\_\-comm\_\-rx\_\-queue.c.

References rx\_\-linked\_\-list::first, INTERNAL\_\-COMM\_\-RX\_\-QUEUE\_\-SIZE, rx\_\-linked\_\-list::last, and rx\_\-linked\_\-list::message.

Referenced by ISR().\hypertarget{internal__comm__rx__queue_8h_41645be7df154233c61d3789752ae6e2}{
\index{internal\_\-comm\_\-rx\_\-queue.h@{internal\_\-comm\_\-rx\_\-queue.h}!int\_\-comm\_\-rx\_\-queue\_\-drop@{int\_\-comm\_\-rx\_\-queue\_\-drop}}
\index{int\_\-comm\_\-rx\_\-queue\_\-drop@{int\_\-comm\_\-rx\_\-queue\_\-drop}!internal_comm_rx_queue.h@{internal\_\-comm\_\-rx\_\-queue.h}}
\subsubsection[{int\_\-comm\_\-rx\_\-queue\_\-drop}]{\setlength{\rightskip}{0pt plus 5cm}void int\_\-comm\_\-rx\_\-queue\_\-drop (void)}}
\label{internal__comm__rx__queue_8h_41645be7df154233c61d3789752ae6e2}


Drops the first message in the queue Frees up the memory space aswell. 

Definition at line 66 of file internal\_\-comm\_\-rx\_\-queue.c.

References rx\_\-linked\_\-list::first, and INTERNAL\_\-COMM\_\-RX\_\-QUEUE\_\-SIZE.

Referenced by internal\_\-comm\_\-poll\_\-rx\_\-queue().\hypertarget{internal__comm__rx__queue_8h_39b69a3f665580fc26505892fe38a649}{
\index{internal\_\-comm\_\-rx\_\-queue.h@{internal\_\-comm\_\-rx\_\-queue.h}!int\_\-comm\_\-rx\_\-queue\_\-dropall@{int\_\-comm\_\-rx\_\-queue\_\-dropall}}
\index{int\_\-comm\_\-rx\_\-queue\_\-dropall@{int\_\-comm\_\-rx\_\-queue\_\-dropall}!internal_comm_rx_queue.h@{internal\_\-comm\_\-rx\_\-queue.h}}
\subsubsection[{int\_\-comm\_\-rx\_\-queue\_\-dropall}]{\setlength{\rightskip}{0pt plus 5cm}void int\_\-comm\_\-rx\_\-queue\_\-dropall (void)}}
\label{internal__comm__rx__queue_8h_39b69a3f665580fc26505892fe38a649}


Erase all content in the TX queue. 

\begin{Desc}
\item[Returns:]The number of items that were cleared \end{Desc}


Definition at line 76 of file internal\_\-comm\_\-rx\_\-queue.c.

References rx\_\-linked\_\-list::first, and rx\_\-linked\_\-list::last.

Referenced by internal\_\-comm\_\-init().\hypertarget{internal__comm__rx__queue_8h_6564d12f3118d4f012088efa9b764b00}{
\index{internal\_\-comm\_\-rx\_\-queue.h@{internal\_\-comm\_\-rx\_\-queue.h}!int\_\-comm\_\-rx\_\-queue\_\-get@{int\_\-comm\_\-rx\_\-queue\_\-get}}
\index{int\_\-comm\_\-rx\_\-queue\_\-get@{int\_\-comm\_\-rx\_\-queue\_\-get}!internal_comm_rx_queue.h@{internal\_\-comm\_\-rx\_\-queue.h}}
\subsubsection[{int\_\-comm\_\-rx\_\-queue\_\-get}]{\setlength{\rightskip}{0pt plus 5cm}{\bf UC\_\-MESSAGE} int\_\-comm\_\-rx\_\-queue\_\-get (void)}}
\label{internal__comm__rx__queue_8h_6564d12f3118d4f012088efa9b764b00}


Retrieve the first message from the FIFO TX queue. 

\begin{Desc}
\item[Returns:]The first message in the queue \end{Desc}


Definition at line 59 of file internal\_\-comm\_\-rx\_\-queue.c.

References rx\_\-linked\_\-list::first, and rx\_\-linked\_\-list::message.

Referenced by internal\_\-comm\_\-poll\_\-rx\_\-queue().\hypertarget{internal__comm__rx__queue_8h_e24971f6543c6471788b8b042331909b}{
\index{internal\_\-comm\_\-rx\_\-queue.h@{internal\_\-comm\_\-rx\_\-queue.h}!int\_\-comm\_\-rx\_\-queue\_\-is\_\-empty@{int\_\-comm\_\-rx\_\-queue\_\-is\_\-empty}}
\index{int\_\-comm\_\-rx\_\-queue\_\-is\_\-empty@{int\_\-comm\_\-rx\_\-queue\_\-is\_\-empty}!internal_comm_rx_queue.h@{internal\_\-comm\_\-rx\_\-queue.h}}
\subsubsection[{int\_\-comm\_\-rx\_\-queue\_\-is\_\-empty}]{\setlength{\rightskip}{0pt plus 5cm}unsigned char int\_\-comm\_\-rx\_\-queue\_\-is\_\-empty (void)}}
\label{internal__comm__rx__queue_8h_e24971f6543c6471788b8b042331909b}


Check if the queue is empty. 

\begin{Desc}
\item[Returns:]1 if the queue is empty and 0 otherwise \end{Desc}


Definition at line 84 of file internal\_\-comm\_\-rx\_\-queue.c.

References rx\_\-linked\_\-list::first, and rx\_\-linked\_\-list::last.

Referenced by internal\_\-comm\_\-poll\_\-rx\_\-queue().